package cn.com.surker.system.model;

import cn.com.surker.system.entity.DataSourceInfo;
import cn.com.surker.system.entity.SysUser;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author lucky
 * @create 2021年02月23 21:18
 * @desc
 */
@Data
public class CacheUser extends SysUser implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * 部门ID
     */
    private Long originId;

    /**
     * 部门名称
     */
    private String originName;

    /**
     * 收料站点ID
     */
    private Integer materialStationId;

    /**
     * 部门全称
     */
    private String originFullName;

    /**
     * 登录IP
     */
    private String ip;

    /**
     * 登录token
     */
    private String token;
    /**
     * 加密密钥  由密码种子+手机号生成的md5加密值
     */
    private String secret;
    /**
     * deviceId : 设备id
     */
    private String deviceId;

    /**
     * 云端表名
     */
    private String tableName;

    /**
     * 访问权限列表
     */
    private List<String> roleList = new ArrayList<>();

    private List<String> roleNameList = new ArrayList<>();

    /**
     * 操作人ERP系统ID
     */
    private Integer creatorId;

    /**
     * 数据库连接信息
     */
    private DataSourceInfo dataSourceInfo;

    public CacheUser(SysUser sysUser) {
        super();
        setId(sysUser.getId());
        setUsername(sysUser.getUsername());
        setPassword(sysUser.getPassword());
        setStatus(sysUser.getStatus());
        setCreateTime(sysUser.getCreateTime());
        setRegisterIp(sysUser.getRegisterIp());
        setPhone(sysUser.getPhone());
        setNickname(sysUser.getNickname());
        setEmail(sysUser.getEmail());
        setName(sysUser.getName());
        setOpenid(sysUser.getOpenid());
        setUnionid(sysUser.getUnionid());
        setAppid(sysUser.getAppid());
        setPosition(sysUser.getPosition());
        setAvatarUrl(sysUser.getAvatarUrl());
        setPhone(sysUser.getPhone());
        setSex(sysUser.getSex());
        setCardNo(sysUser.getCardNo());
        setBirthday(sysUser.getBirthday());
        setOpenPwd(sysUser.getOpenPwd());
    }

    public CacheUser(){

    }

}
